

function addSensorbitCod(Blockly) {




   //矩阵键盘初始化
  Blockly.Python.microbit_maxtixKeyPadInit = function(block) {
    var dropdown_pianoCLK = this.getFieldValue('maxtixKeypadCLK');
    var dropdown_pianoDIO = this.getFieldValue('maxtixKeypadDIO');
    Blockly.Python.definitions_['import_microbit'] = 'from microbit import *';
    Blockly.Python.definitions_['import_TouchMaxtixKeypad'] = 'from input import maxtix_keypad';
    Blockly.Python.definitions_['maxtixKeypad_init'] = 'maxtix_keypad.init('+dropdown_pianoCLK+', '+dropdown_pianoDIO+')\n';
    return '';
  }
//矩阵键盘模块 获取键盘按下的值
Blockly.Python.microbit_maxtixKeyPadGetValue = function(block) {
  // var dropdown_piano2 = this.getFieldValue('maxtixKeypad');
  var code = 'key = maxtix_keypad.get_key()\n';
  // var code = 'key == ' + dropdown_piano2;
  return code;
}

//矩阵键盘模块  判断
Blockly.Python.microbit_maxtixKeyPad = function(block) {
  var dropdown_maxtixValue = this.getFieldValue('maxtixKeypad');
  Blockly.Python.definitions_['codeLine_maxtixData'] = '  key = maxtix_keypad.get_key()';
  var code = 'key == ' + dropdown_maxtixValue;
  return [code];
}

    return Blockly;
}

module.exports = addSensorbitCod;

